<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<%@taglib prefix="code" tagdir="/WEB-INF/tags"%>

<div style="margin:20px 0;"></div>
<div class="easyui-panel">
	<div style="padding:10px 60px 20px 60px">
	<form id="noticeInfForm"  name="noticeInfForm" method="post" action="<c:url value='/notice/saveNoticeInfDetail.do'/>">
	<input type="hidden" id="notice_uuid" name="notice_uuid" value="${infEntity.notice_uuid}"/>
	<input type="hidden" id="ins_uuid" name="ins_uuid" value="${infEntity.ins_uuid}"/>
	<input type="hidden" id="rec_id" name="rec_id" value="${infEntity.rec_id}"/>
	<input type="hidden" id="publish_st" name="publish_st" value="${infEntity.publish_st}"/>
			<table cellpadding="5" style="width:100%">
				<tr>
					<td>所属机构:</td>
					<td>
						<input class="easyui-textbox"  data-options="required:true" type="text" readonly="readonly" id="inst_name" value="${infEntity.inst_name}"/>
						<a href="javascript:void(0)" class="easyui-linkbutton detail-remove" iconCls="icon-search" id="selelctBtn">选择</a>
					</td>
				</tr>
				<tr>
					<td>标题:</td>
					<td><input class="easyui-textbox" type="text"  name="notice_title" data-options="required:true,multiline:true,validType:['length[0,80]']" value="${infEntity.notice_title}"></input></td>
				</tr>
				<tr>
					<td>内容:</td>
					<td><input class="easyui-textbox" name="notice_content" style="height:300px;width:500px" data-options="required:true,multiline:true,validType:['length[0,1300]']" value="${infEntity.notice_content}"/></td>
				</tr>
			</table>
	<div style="text-align:center;padding:5px">
		<a href="javascript:void(0)" class="easyui-linkbutton btn detail-remove" iconCls="icon-save" onclick="submitForm('noticeInfForm')">保存</a>
		<a href="javascript:void(0)" class="easyui-linkbutton btn" iconCls="icon-back" onclick="back()">返回</a>
	</div>
</form>
	</div>
</div>

<div id="menuTree">
	<div id="ztreeObj" class="ztree"></div>
</div>
<script>
    var ztreeObj;
    /*选择按钮*/
    $("#selelctBtn").click(function(){
        ztreeObj = showAppTree(selected, $("#ins_uuid").val());
    });

    /*确定按钮回调*/
    function selected(){
        var nodes = ztreeObj.getSelectedNodes();
        console.log(nodes);
        if(nodes && nodes.length > 0){
            $("#inst_name").textbox("setValue", nodes[0].NAME);
            $("#ins_uuid").val(nodes[0].ID);
        }
    }
    function showAppTree(confirmCallback, uuid, option){
        var options = {
            url: "../organization/getAppInfTree.do",
            title: "选择机构",
            confirmCallback: confirmCallback,
            openIds: uuid,
            showSearch: true,
            searchTitle: "机构代码/名称"
        };
        options = $.extend({}, options, option);
        return showTree(options);
    }
    function showTree(options){
        var jpTree = $().jpTree(options);
        return jpTree;
    }
</script>